package models;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "VVehicleInfo")
public class VVehicleInfoEntity {
    private int id;
    private Double latitude;
    private Double longitude;
    private String sendTime;
    private String plateNo;

    @Id
    @Column(name = "ID", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "Latitude", nullable = true, precision = 0)
    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    @Basic
    @Column(name = "Longitude", nullable = true, precision = 0)
    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    @Basic
    @Column(name = "SendTime", nullable = true, length = 16)
    public String getSendTime() {
        return sendTime;
    }

    public void setSendTime(String sendTime) {
        this.sendTime = sendTime;
    }

    @Basic
    @Column(name = "PlateNo", nullable = true, length = 255)
    public String getPlateNo() {
        return plateNo;
    }

    public void setPlateNo(String plateNo) {
        this.plateNo = plateNo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        VVehicleInfoEntity that = (VVehicleInfoEntity) o;
        return id == that.id &&
                Objects.equals(latitude, that.latitude) &&
                Objects.equals(longitude, that.longitude) &&
                Objects.equals(sendTime, that.sendTime) &&
                Objects.equals(plateNo, that.plateNo);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, latitude, longitude, sendTime, plateNo);
    }
}
